import java.util.Scanner;
public class Main {
	public static void main(String args[]){
		Scanner can= new Scanner(System.in);
		int[] a = new int[10];
		for(int i=0;i<a.length;i++) {
			a[i] = can.nextInt();
		}
		int c = a[0];
		for(int i=0;i<a.length;i++)
		{
			if(a[i]>c)   
				c=a[i];
		}
		int x = 0;
		for(int i=0;i<a.length;i++)
		{
			if(c==a[i])   
			x = i;
		}
		int f ;
		f = a[0];
		a[0] = a[x];
		a[x] = f;
		for(int i =0; i<a.length;i++) {
			System.out.printf("%4d", a[i]);
		}
		System.out.println();
		System.out.print("max="+c+","+"weizhi="+x);
	}
}
